﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddFoto_Categoria.aspx.cs" Inherits="NewTierra.Pages.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

    <link href="../../Styles/jquery-ui.css" rel="stylesheet" />    
    <script type="text/javascript" src="../../Scripts/jquery-1.11.0.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery-ui-1.10.0.js"></script>

    <script src="../../Scripts/jquery.MultiFile.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.lightbox-0.5.js" type="text/javascript"></script>
    <link href="../../Styles/jquery.lightbox-0.5.css" rel="stylesheet" type="text/css" />
    <link href="../../Styles/Site.css" rel="stylesheet" type="text/css" />
    <link href="../../Styles/EstiloGeral.css" rel="stylesheet" type="text/css" />

    <style type="text/css">
        .invisible
        {
            display: none;
        }

        #AddFotoCategoria
        {
            width: 777px;
            padding: 10px;
        }

        #EnviarVerFotos
        {
            height: 381px;
        }

            #EnviarVerFotos .Upload
            {
                height: 323px;
                width: 429px;
                float: left;
            }

            #EnviarVerFotos .DataListFotos
            {
                width: 318px;
                float: left;
                height: 339px;
            }

        #scroll
        {
            width: 296px;
            height: 337px;
            overflow: auto;
            margin-top: 0px;
        }

        #CategoriaVerFotos
        {
            height: 174px;
            width: 734px;
            margin-top: 10px;
        }

            #CategoriaVerFotos .formularioCategoria
            {
                width: 440px;
                float: left;
            }

            #CategoriaVerFotos .gridCategorias
            {
                height: 169px;
                float: left;
                width: 283px;
            }

            #CategoriaVerFotos .IncluirCategoria
            {
                height: 121px;
                width: 139px;
                float: left;
            }

        #form1
        {
            width: 769px;
        }
    </style>

    <script type="text/javascript">

        $(document).ready(function () {
            $('#gallery a').lightBox();
        });

    </script>

    <title></title>
</head>
<body>

    <form id="form1" runat="server" enctype="multipart/form-data">

        <asp:ScriptManager ID="Scriptmanager1" runat="server"></asp:ScriptManager>

        <div id="AddFotoCategoria">
            <asp:TabContainer ID="TabFotoCategoria" runat="server" Width="775px" Height="373px"
                ActiveTabIndex="0" BorderWidth="0px" BorderStyle="None">

                <asp:TabPanel ID="TabFoto" runat="server" HeaderText="Fotos">
                    <ContentTemplate>

                        <div id="EnviarVerFotos">
                            <div class="Upload">
                                <br />
                                <asp:Label ID="lblSupplierNomeFotosTXT" runat="server" Text="Supplier:"></asp:Label>
                                &nbsp;<asp:Label ID="lblSupplierNomeEnviarVerFotos" runat="server"></asp:Label>
                                <br />
                                <br />
                                <asp:FileUpload ID="FileUpload1" runat="server" class="multi" />
                                <br />
                                <asp:Button ID="btnUpload" CssClass="btnsGeral" runat="server" Text="Enviar" OnClick="UploadFotoSupplier" />
                                <br />
                                <asp:Label ID="lblMsgEnviarFotos" runat="server" Font-Bold="True" ForeColor="#CC0000" Font-Size="Small"></asp:Label>
                                <br />
                            </div>
                            <div class="DataListFotos">
                                <div class="popular-foto-container">
                                    <div id="scroll">
                                        <div id="gallery">
                                            <asp:DataList ID="DataListFotos" runat="server" Width="16px" RepeatDirection="Horizontal" RepeatColumns="3"
                                                CellPadding="0"
                                                Height="16px">
                                                <ItemTemplate>                                                    

                                                    <div class="popular-foto-col">
                                                        <div class="popular-foto-img-border">                                                            

                                                            <a href='<%# String.Format("/NewTierra/Galeria/{0}/{1}", DataBinder.Eval(Container.DataItem,"S_id"), DataBinder.Eval(Container.DataItem, "Image_nome"))%>'>
                                                                <asp:Image ID="Image2" runat="server" Height="70px" Width="70px" ImageUrl='<%# String.Format("/NewTierra/Galeria/{0}/{1}", DataBinder.Eval(Container.DataItem,"S_id"), DataBinder.Eval(Container.DataItem, "Image_nome"))%>' ToolTip='<%# DataBinder.Eval(Container.DataItem,"Image_memo") %>' /></a>
                                                                <asp:Label ID="lblIdImage" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"Image_id") %>' Visible="false" />

                                                            <br />                                                                                                                        
                                                        </div>
                                                    </div>
                                                    &nbsp;&nbsp;<asp:ImageButton ID="ImageButton2" runat="server" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"Image_id") %>' ImageUrl="~/images/Icones/icone_excluir.png" OnCommand="ExcluirFoto" ToolTip="Excluir Foto" />
                                                    <asp:ImageButton ID="ImageButton1" runat="server" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"Image_id") %>' ImageUrl="~/images/Icones/camera.png" OnCommand="CapaFoto" ToolTip="Colocar foto como imagem principal." />

                                                    <asp:ImageButton ID="imgAddNomeFoto" runat="server" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"Image_id") %>' ImageUrl="~/images/plus-small.png" OnCommand="imgAddNomeFoto_Command" ToolTip="Add nome foto" />                                                                                                        
                                                    <br />
                                                    <asp:TextBox ID="txtMemoFoto" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"Image_Memo") %>' MaxLength="50" Width="50px" OnTextChanged="txtMemoFoto_TextChanged" style="margin-left: 7px;" Visible="false" AutoPostBack="true" />
                                                </ItemTemplate>

                                            </asp:DataList>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>

                    </ContentTemplate>
                </asp:TabPanel>



                <asp:TabPanel ID="TabCategoria" runat="server" HeaderText="Categoria">
                    <ContentTemplate>

                        <div id="CategoriaVerFotos">

                            <div class="formularioCategoria">
                                <table style="width: 98%;">
                                    <tr>
                                        <td class="style1">
                                            <asp:Label ID="lblSupplierNomeCategoriaTXT" runat="server" Text="Supplier:"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblSupplierNomeCategoriaVerFotos" runat="server"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style1">
                                            <asp:Label ID="lblClassificacaoTXT" runat="server" Text="Classificação:"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblClassificacao" runat="server"></asp:Label>
                                            <asp:TextBox ID="txtClassificacao" runat="server" Visible="False"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                                                ControlToValidate="txtClassificacao" ErrorMessage="*"
                                                ToolTip="Favor informar a classificação." ValidationGroup="SalvarCateg"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style1">
                                            <asp:Label ID="lblImageTXT" runat="server" Text="Imagem:"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Image ID="ImgCategoria" runat="server" />
                                            <asp:FileUpload ID="FileUploadCategoria" runat="server" Visible="False" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style1">&nbsp;</td>
                                        <td>
                                            <asp:Button ID="btnInserirCategoria" CssClass="btnsGeral" runat="server"
                                                OnClick="btnInserirCategoria_Click" Text="Inserir Nova" />
                                            &nbsp;<asp:Button ID="btnSalvarCategoria" runat="server" CssClass="btnsGeral" Text="Salvar" Visible="False"
                                                OnClick="SalvaCategoria" ValidationGroup="SalvarCateg" />
                                            &nbsp;<asp:Button ID="btnCancelarCategoria" runat="server" CssClass="btnsGeral" Text="Cancelar" Visible="False"
                                                OnClick="btnCancelarCategoria_Click" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style1">&nbsp;</td>
                                        <td>
                                            <asp:Label ID="lblMsgCategorias" runat="server" Font-Bold="True" ForeColor="#CC0000" Font-Size="Small">Clique em editar para atualizar a classificação.</asp:Label>
                                        </td>
                                    </tr>
                                </table>
                            </div>

                            <div class="gridCategorias">


                                <asp:GridView ID="GridCategorias" runat="server" AllowPaging="True"
                                    AutoGenerateColumns="False" GridLines="None" CssClass="mGrid" OnPageIndexChanging="PaginarDadosCategoria"
                                    Height="145px" PageSize="5"
                                    OnSelectedIndexChanged="GridCategorias_SelectedIndexChanged">
                                    <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>

                                    <Columns>
                                        <asp:BoundField DataField="Categ_id" HeaderText="ID" InsertVisible="False"
                                            ReadOnly="True" SortExpression="Categ_id">
                                            <FooterStyle CssClass="invisible" />
                                            <HeaderStyle CssClass="invisible" />
                                            <ItemStyle CssClass="invisible" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Categ_classificacao" HeaderText="Calssificação"
                                            SortExpression="Categ_classificacao">
                                            <HeaderStyle Wrap="False" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Categ_imgnome" HeaderText="Extenção"
                                            SortExpression="Categ_imgnome" Visible="False" />
                                        <asp:TemplateField HeaderText="Img">
                                            <ItemTemplate>
                                                <asp:Image ID="Image1" runat="server" Height="17px"
                                                    ImageUrl='<%# DataBinder.Eval(Container.DataItem,"Categ_imgnome", "~/ImgCategorias/{0}" ) %>' Width="89px" />
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:CommandField HeaderText="Editar" SelectText="Editar"
                                            ShowSelectButton="True" />
                                    </Columns>

                                    <PagerStyle CssClass="pgr"></PagerStyle>

                                </asp:GridView>

                            </div>

                        </div>

                    </ContentTemplate>
                </asp:TabPanel>

            </asp:TabContainer>
        </div>

    </form>
</body>
</html>
